<?php

class LoanStatusChanges extends HTech_Db_Table
{
    protected $_name     = 'view_loan_status_changes';
    protected $_primary  = 'Id';
    
    protected $_referenceMap    = array(
        'Loans' => array(
            'columns'           => array('LoanId'),
            'refTableClass'     => 'Loans',
            'refColumns'        => array('LoanId')
        )
    );
    
    protected function _setGridMetadata()
    {
        $this->_gridMetadata['title'] = $this->translate("Loan status changes");
        $this->_gridMetadata['params'] = array('LoanId');
        $this->_gridMetadata['headers'] = array
            (
                array('Id',             50, $this->translate("Id"),            'Number'),
                array('PreviousStatus', 80, $this->translate("Prev. status"),  'String'),
                array('Status',         80, $this->translate("Status"),        'String'),
                array('Datetime',      150, $this->translate("Datetime"),      'DateTime', 'Date'),
                array('Username',      100, $this->translate("User"),          'String'),
                array('Comments',      300, $this->translate("Comments"),      'String')
            );
        return $this;
    }
}